package zoo.qboard.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.productqnareplyboard.admin.domain.AdminProductReplyBoardCommand;
import zoo.qboard.domain.QboardCommand;

public class QboardDaoImpl extends SqlSessionDaoSupport implements QboardDao{

	@Override
	public List<QboardCommand> qBoardList(Map<String, Object> map) {
		List<QboardCommand> list = getSqlSession().selectList("selectQboardList", map);
		return list;
	}

	@Override
	public int getQboardCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("selectQboardCount", map);
	}

	@Override
	public void insertQboard(QboardCommand board) {
		getSqlSession().insert("insertQboard",board);
	}

	@Override
	public QboardCommand selectQBoard(Integer seq) {
		QboardCommand qboard = getSqlSession().selectOne("detailQboard",seq);
		return qboard;
	}

	@Override
	public void updateHitq(Integer seq) {
		getSqlSession().update("updateQboardreadcntr", seq);
		
	}

	@Override
	public void updateQboard(QboardCommand qboard) {
		getSqlSession().update("updateQboard", qboard);
	}

	@Override
	public void deleteQboard(Integer seq) {
		getSqlSession().delete("deleteQboard", seq);		
	}

	@Override
	public List<AdminProductReplyBoardCommand> qreyList(Integer bq_num) {
		List<AdminProductReplyBoardCommand> list = getSqlSession().selectList("qnaRey",bq_num);
		return list;
	}

}
